<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMachinesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('machines', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name',50)->default('')->comment('机器名称');
            $table->integer('shop_id')->unsigned()->index()->default(0)->comment('店铺ID');
            $table->tinyInteger('status')->unsigned()->default(1)->comment('状态,1-启用，0-停用');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `machines` comment '机器表'");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('machines');
    }
}
